package com.community.content;

import com.event.content.EventListViewActivity;
import com.example.logindesign.Mainmenu;
import com.example.logindesign.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

public class CommunityStatisticsActivity extends Activity {
	// 返回按钮
	private ImageButton btnBack;
	
	// 63个TextView
	// 户数统计
	private TextView hjhsTextView, jzhsTextView, zzhsTextView, syhsTextView,
			jsythsTextView, qthsTextView, wxzhsTextView;
	// 人口统计
	private TextView hjrksTextView, jzrksTextView, zzrksTextView,
			syrksTextView, jsytrksTextView, qtrksTextView, wxzrksTextView;
	// 性别
	private TextView nanTextView, nvTextView;
	// 育龄妇女
	private TextView zgylTextView, xgylTextView, ldylTextView, qtylTextView;
	// 人口类型
	private TextView czrkTextView, ldrkTextView, wjrkTextView;
	// 文化程度
	private TextView wmwhTextView, xxwhTextView, czwhTextView, gzwhTextView,
			jxwhTextView, zzwhTextView, dzwhTextView, bkwhTextView,
			yjswhTextView;
	// 政治庙貌
	private TextView zgdyTextView, gqtyTextView, qzTextView, mzdpTextView,
			wdpTextView;
	// 婚姻状况
	private TextView whTextView, chTextView, zhTextView, lyTextView,
			soTextView;
	// 养老保险
	private TextView czzgTextView, czjmTextView, xxncTextView;
	// 医疗保险
	private TextView czzgylTextView, czjmylTextView, xxncylTextView;
	// 低保人员
	private TextView xgdbTextView, sydbTextView, wydbTextView, qtdbTextView;
	// 其他
	private TextView jyyzqtTextView, dbjzqtTextView, xgsyqtTextView,
			cjqtTextView, zyzqtTextView, dxsqtTextView, xzzqtTextView,
			ggqtTextView, lzfqtTextView, dqqtTextView, sdqtTextView;
	// TextView 的值
	// 户数统计
	private String hjhsValue, jzhsValue, zzhsValue, syhsValue,
			jsythsValue, qthsValue, wxzhsValue;
	// 人口统计
	private String hjrksValue, jzrksValue, zzrksValue,
			syrksValue, jsytrksValue, qtrksValue, wxzrksValue;
	// 性别
	private String nanValue, nvValue;
	// 育龄妇女
	private String zgylValue, xgylValue, ldylValue, qtylValue;
	// 人口类型
	private String czrkValue, ldrkValue, wjrkValue;
	// 文化程度
	private String wmwhValue, xxwhValue, czwhValue, gzwhValue,
			jxwhValue, zzwhValue, dzwhValue, bkwhValue,
			yjswhValue;
	// 政治庙貌
	private String zgdyValue, gqtyValue, qzValue, mzdpValue,
			wdpValue;
	// 婚姻状况
	private String whValue, chValue, zhValue, lyValue,
			soValue;
	// 养老保险
	private String czzgValue, czjmValue, xxncValue;
	// 医疗保险
	private String czzgylValue, czjmylValue, xxncylValue;
	// 低保人员
	private String xgdbValue, sydbValue, wydbValue, qtdbValue;
	// 其他
	private String jyyzqtValue, dbjzqtValue, xgsyqtValue,
			cjqtValue, zyzqtValue, dxsqtValue, xzzqtValue,
			ggqtValue, lzfqtValue, dqqtValue, sdqtValue;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_community_statistics_kuiwen);
		// 绑定textview 及 backbutton 按钮
		initTextViewEtc();
	}

	/**
	 * 绑定textview 及 backbutton 按钮
	 */
	private void initTextViewEtc() {
		// TODO Auto-generated method stub
		// findviewbyid
		// xTextView = findViewById();
		btnBack = (ImageButton) findViewById(R.id.btn_community_back);
		btnBack.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// 跳转到menu页面
				skipMainMenuActivity();
			}
		});
		// setText
		setTextViewValue();
	}

	/**
	 * 设置TextView的值
	 */
	private void setTextViewValue() {
		// TODO Auto-generated method stub

	}

	/**
	 * 跳转到mainmenu页面
	 */
	private void skipMainMenuActivity() {
		Intent mainmenuIntent = new Intent();
		mainmenuIntent.setClass(CommunityStatisticsActivity.this,
				Mainmenu.class);
		// 如果前面的activity 没有主动finish 推到栈顶，不然画面会刷一下
		// mainmenuIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		CommunityStatisticsActivity.this.startActivity(mainmenuIntent);
		CommunityStatisticsActivity.this.finish();
	}

	/**
	 * 重写keydown事件
	 */
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			skipMainMenuActivity();
			return true;
		}
		return super.onKeyDown(keyCode, event);
	}
}
